netfilter: nft_set_rbtree: use read spinlock to avoid datapath contention
authorSasha Levin <sashal@kernel.org>
Fri, 22 Sep 2023 16:30:25 +0000 (18:30 +0200)
committerSalvatore Bonaccorso <carnil@debian.org>
Fri, 29 Sep 2023 04:15:31 +0000 (05:15 +0100)
commit98673bf6acc72cbf0a6af5462ed1776e24b0ca81
tree0aed6104d1520520c71f3698a03a724e73c424a0
parent1678607a878f616f475e4254761c54b65f583b83
netfilter: nft_set_rbtree: use read spinlock to avoid datapath contention

commit 96b33300fba880ec0eafcf3d82486f3463b4b6da upstream.

rbtree GC does not modify the datastructure, instead it collects expired
elements and it enqueues a GC transaction. Use a read spinlock instead
to avoid data contention while GC worker is running.

Fixes: f6c383b8c31a ("netfilter: nf_tables: adapt set backend to use GC transaction API")
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Gbp-Pq: Topic bugfix/all
Gbp-Pq: Name netfilter-nft_set_rbtree-use-read-spinlock-to-avoid-.patch
net/netfilter/nft_set_rbtree.c